<template>
	<view class="announcement">
		<view class="listBox" >
			<view class="listitem"  v-for="(item,index) in dataList" @click="handleDetail(item)">
				<view class="" >
					【{{item.title}}】
				</view>
				<image src="../../static/image/right.png" mode="" style="width: 14.88rpx;height: 28rpx;"></image>
			</view>
			
		</view>
		
	</view>
</template>

<script>
	import {
		notice
	} from "@/api/api.js"
	export default{
		data(){
			return{
				dataList:[]
			}
		},
		onLoad() {
			if (!uni.getStorageSync("token")) {
				uni.reLaunch({
					url: "../login/index"
				})
				return
			}
			this.handleGetnotice()
		},
		methods:{
			async handleGetnotice(){
				let res = await notice()
				// console.log("公告",res)
				this.dataList = res.data
			},
			handleDetail(item){
				// console.log("item",item)
				uni.navigateTo({
					url:`./announcemenDetail?id=${item.id}`
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.listBox{
		width: 100%;
		padding: 0 30rpx;
		box-sizing: border-box;
		.listitem{
			width: 100%;
			height: 88rpx;
			background: #FFFFFF;
			border-radius: 6rpx 6rpx 6rpx 6rpx;
			font-size: 30rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: 600;
			color: #333333;
			line-height: 88rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 30rpx;
			box-sizing: border-box;
			margin-bottom: 16rpx;
		}
	}
	
</style>